<template>
  <div class="wrapper" ref="wrapper">
    <div class="content">
      <slot></slot>
    </div>

  </div>
</template>

<script>
  import BScroll from 'better-scroll'

  export default {
    name: "Scroll",
    data() {
      return {}
    },
    props: {},
    methods: {
      initData(){
        setTimeout(()=>{
          this.$nextTick(() => {
            // 这种方式不好，可能类名重复了；默认获取的是这个类名的第一个元素
            // const dom = document.querySelector('.wrapper')
            const dom = this.$refs.wrapper
            const bs = new BScroll(dom, {})
          })
        },1000)
      }
    },
    mounted() {

      this.initData()
    }
  }
</script>

<style scoped lang="less">
.wrapper{
  height: 100%;
  overflow: hidden;
}
</style>
